|
![](/i/fill.gif) |
Captain Jack wrote:
> JOIN all by itself wouldn't return any rows at all in that example if there
> weren't any matchs in the 5 row table.
Note the difference between a relational join and the JOIN word in SQL.
A relational join is a cartesian cross-product. A JOIN in SQL requires you
to filter the results, because you almost never ever want an actual
cartesian cross-product.
I.e., in relational database theory, a join gives you each row of the first
table concatenated with each row of the second table. Then you select the
rows where the keys are equal, then you project over the rows you actually
want. Those are the three basic reading operations in relational theory. The
only reason "inner join" and "outer join" exist is that people don't want to
actually normalize their databases the way that works well with relational
theory.
SQL kind of weirds up the syntax some, but that doesn't mean you should use
an entirely different (and incorrect) word for the operation. :-) If you're
going to ask for a different word, ask for one that doesn't mean something
wrong. :-)
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
![](/i/fill.gif) |